package com.taxi.apipassenger.remote;

import com.taxi.common.dto.ResponseResult;
import com.taxi.common.response.NumberCodeResponse;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @Author: Ruomeng
 * @Date: 2024/1/2
 * @Description : online-taxi
 * @Version: 1.0
 */
@Component
public class ServiceVerificationCodeFallbackFactory implements FallbackFactory<ServiceVefificationcodeClient> {

    @Override
    public ServiceVefificationcodeClient create(Throwable cause) {
        cause.printStackTrace();
        return new ServiceVefificationcodeClient() {
            @Override
            public ResponseResult<NumberCodeResponse> getNumberCode(int size, String tag) {
                NumberCodeResponse numberCodeResponse = new NumberCodeResponse();
                numberCodeResponse.setNumberCode("111111");
                return ResponseResult.success(numberCodeResponse);
            }
        };
    }
}
